//通用函数


//高亮显示要素几何对象，高亮显示后移除，高亮红色
function setHightEffct(geometry){

    require([
        "esri/map", "esri/layers/FeatureLayer",
        "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
        "esri/renderers/SimpleRenderer", "esri/graphic",
        "esri/Color", "dojo/number", "dojo/dom-style",
          "dojo/domReady!"
      ], function(
        Map, FeatureLayer,
        SimpleFillSymbol, SimpleLineSymbol,
        SimpleRenderer, Graphic,
        Color, number, domStyle

      ) {

    var highlightSymbol = new SimpleFillSymbol(
          SimpleFillSymbol.STYLE_SOLID,
          new SimpleLineSymbol(            SimpleLineSymbol.STYLE_SOLID,
            new Color([255,0,0]), 3
          ),
          new Color([125,125,125,0.35])
        );

     var highlightGraphic = new Graphic(geometry,highlightSymbol);
     setTimeout(function(){map.graphics.add(highlightGraphic);},0);
     setTimeout(function(){ map.graphics.clear();},1500);
       });
}

//高亮显示要素几何对象,高亮显示后移除,高亮绿色
function setHightPolygonEffect(geometry){

    require([
        "esri/map", "esri/layers/FeatureLayer",
        "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
        "esri/renderers/SimpleRenderer", "esri/graphic",
        "esri/Color", "dojo/number", "dojo/dom-style",
          "dojo/domReady!"
      ], function(
        Map, FeatureLayer,
        SimpleFillSymbol, SimpleLineSymbol,
        SimpleRenderer, Graphic,
        Color, number, domStyle

      ) {

    var highlightSymbol = new SimpleFillSymbol(
          SimpleFillSymbol.STYLE_SOLID,
          new SimpleLineSymbol(            SimpleLineSymbol.STYLE_SOLID,
            new Color([0,255,255]), 3
          ),
          new Color([125,125,125,0.35])
        );

     var highlightGraphic = new Graphic(geometry,highlightSymbol);
     setTimeout(function(){map.graphics.add(highlightGraphic);},0);
     setTimeout(function(){map.graphics.remove(highlightGraphic);},1500);}
           
           );
  

}

function addHightLine(geometry){

    map.graphics.clear();
    require(["esri/symbols/SimpleLineSymbol","esri/graphic",
        "esri/Color"], function(SimpleLineSymbol, Graphic,
        Color) { 
        var highlightSymbol = new SimpleLineSymbol();
        highlightSymbol.setColor(new Color([0,255,255,1]));
        highlightSymbol.setWidth(3);
        var highlightGraphic = new Graphic(geometry,highlightSymbol);
       setTimeout(function(){map.graphics.add(highlightGraphic);},0);
        
        /* code goes here */ });
    
    
//     require([
//         "esri/map", "esri/layers/FeatureLayer",
//         "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol",
//         "esri/renderers/SimpleRenderer", "esri/graphic",
//         "esri/Color", "dojo/number", "dojo/dom-style",
//           "dojo/domReady!"
//       ], function(
//         Map, FeatureLayer,
//         SimpleFillSymbol, SimpleLineSymbol,
//         SimpleRenderer, Graphic,
//         Color, number, domStyle

//       ) {

//     var highlightSymbol = new SimpleFillSymbol(
//           SimpleFillSymbol.STYLE_SOLID,
//           new SimpleLineSymbol(            SimpleLineSymbol.STYLE_SOLID,
//             new Color([255,0,0]), 3
//           ),
//           new Color([125,125,125,0])
//         );

//      var highlightGraphic = new Graphic(geometry,highlightSymbol);
//      setTimeout(function(){map.graphics.add(highlightGraphic);},0);
//      //setTimeout(function(){ map.graphics.clear();},1500);
//        });
}
